Optimal. Leaf size=254 \[ -\frac {\sqrt {2} (A-B+C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {4 (147 A-111 B+143 C) \tan (c+d x)}{315 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}-\frac {2 (21 A-93 B+29 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{315 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.59, antiderivative size = 254, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.140, Rules used = {4173, 4106,
4095, 4086, 3880, 209} \begin {gather*} -\frac {\sqrt {2} (A-B+C) \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}+\frac {2 (21 A-3 B+19 C) \tan (c+d x) \sec ^2(c+d x)}{105 d \sqrt {a \sec (c+d x)+a}}-\frac {2 (21 A-93 B+29 C) \tan (c+d x) \sqrt {a \sec (c+d x)+a}}{315 a d}+\frac {4 (147 A-111 B+143 C) \tan (c+d x)}{315 d \sqrt {a \sec (c+d x)+a}}+\frac {2 (9 B-C) \tan (c+d x) \sec ^3(c+d x)}{63 d \sqrt {a \sec (c+d x)+a}}+\frac {2 C \tan (c+d x) \sec ^4(c+d x)}{9 d \sqrt {a \sec (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3880
Rule 4086
Rule 4095
Rule 4106
Rule 4173
Rubi steps
\begin {align*} \int \frac {\sec ^4(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx &=\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}+\frac {2 \int \frac {\sec ^4(c+d x) \left (\frac {1}{2} a (9 A+8 C)+\frac {1}{2} a (9 B-C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{9 a}\\ &=\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}+\frac {4 \int \frac {\sec ^3(c+d x) \left (\frac {3}{2} a^2 (9 B-C)+\frac {3}{4} a^2 (21 A-3 B+19 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{63 a^2}\\ &=\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}+\frac {8 \int \frac {\sec ^2(c+d x) \left (\frac {3}{2} a^3 (21 A-3 B+19 C)-\frac {3}{8} a^3 (21 A-93 B+29 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{315 a^3}\\ &=\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}-\frac {2 (21 A-93 B+29 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{315 a d}+\frac {16 \int \frac {\sec (c+d x) \left (-\frac {3}{16} a^4 (21 A-93 B+29 C)+\frac {3}{8} a^4 (147 A-111 B+143 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{945 a^4}\\ &=\frac {4 (147 A-111 B+143 C) \tan (c+d x)}{315 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}-\frac {2 (21 A-93 B+29 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{315 a d}+(-A+B-C) \int \frac {\sec (c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx\\ &=\frac {4 (147 A-111 B+143 C) \tan (c+d x)}{315 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}-\frac {2 (21 A-93 B+29 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{315 a d}+\frac {(2 (A-B+C)) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=-\frac {\sqrt {2} (A-B+C) \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {4 (147 A-111 B+143 C) \tan (c+d x)}{315 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (21 A-3 B+19 C) \sec ^2(c+d x) \tan (c+d x)}{105 d \sqrt {a+a \sec (c+d x)}}+\frac {2 (9 B-C) \sec ^3(c+d x) \tan (c+d x)}{63 d \sqrt {a+a \sec (c+d x)}}+\frac {2 C \sec ^4(c+d x) \tan (c+d x)}{9 d \sqrt {a+a \sec (c+d x)}}-\frac {2 (21 A-93 B+29 C) \sqrt {a+a \sec (c+d x)} \tan (c+d x)}{315 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 30.31, size = 7186, normalized size = 28.29 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1428\) vs.
\(2(225)=450\).
time = 15.66, size = 1429, normalized size = 5.63
method | result | size |
default | \(\text {Expression too large to display}\) | \(1429\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.94, size = 487, normalized size = 1.92 \begin {gather*} \left [\frac {315 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right )^{5} + {\left (A - B + C\right )} a \cos \left (d x + c\right )^{4}\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) + 4 \, {\left ({\left (273 \, A - 129 \, B + 257 \, C\right )} \cos \left (d x + c\right )^{4} - {\left (21 \, A - 93 \, B + 29 \, C\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (21 \, A - 3 \, B + 19 \, C\right )} \cos \left (d x + c\right )^{2} + 5 \, {\left (9 \, B - C\right )} \cos \left (d x + c\right ) + 35 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{630 \, {\left (a d \cos \left (d x + c\right )^{5} + a d \cos \left (d x + c\right )^{4}\right )}}, \frac {2 \, {\left ({\left (273 \, A - 129 \, B + 257 \, C\right )} \cos \left (d x + c\right )^{4} - {\left (21 \, A - 93 \, B + 29 \, C\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (21 \, A - 3 \, B + 19 \, C\right )} \cos \left (d x + c\right )^{2} + 5 \, {\left (9 \, B - C\right )} \cos \left (d x + c\right ) + 35 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) + \frac {315 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right )^{5} + {\left (A - B + C\right )} a \cos \left (d x + c\right )^{4}\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{315 \, {\left (a d \cos \left (d x + c\right )^{5} + a d \cos \left (d x + c\right )^{4}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{4}{\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.77, size = 405, normalized size = 1.59 \begin {gather*} \frac {\frac {315 \, {\left (\sqrt {2} A - \sqrt {2} B + \sqrt {2} C\right )} \log \left ({\left | -\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {2 \, {\left (315 \, \sqrt {2} A a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 315 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (1050 \, \sqrt {2} A a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 420 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 840 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (1512 \, \sqrt {2} A a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 756 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 1638 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (1134 \, \sqrt {2} A a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 612 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 936 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - {\left (357 \, \sqrt {2} A a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) - 276 \, \sqrt {2} B a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) + 383 \, \sqrt {2} C a^{4} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )}^{4} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}}}{315 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}}{{\cos \left (c+d\,x\right )}^4\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________